package com.yc.spring;

import com.yc.spring.bank.bean.Account;
import org.springframework.context.annotation.*;

@Configuration // ==> beans.xml
public class BeanConfig {

    @Bean("account")
    @Primary
    @Lazy
    // ==> <bean id="account" class="com.yc.spring.bank.bean.Account" scope="singleton">
    public Account getAccount() {
        return new Account();
    }

    @Bean("account1")
    @Scope("prototype")  // 作用域注解
    public Account getAccount1() {
        return new Account();
    }

}
